package com.wlient.basic.designPattern.StateMode;

import com.wlient.basic.designPattern.StateMode.pojo.BookedState;
import com.wlient.basic.designPattern.StateMode.pojo.CheckinState;
import com.wlient.basic.designPattern.StateMode.pojo.FreeTimeState;
import com.wlient.basic.designPattern.StateMode.pojo.HotelContext;

public class StateExample2 {
    public static void main(String[] args) {
        HotelContext hotelContext = new HotelContext();

        //空闲状态
        FreeTimeState freeTimeState = new FreeTimeState();
        hotelContext.setHotelState(freeTimeState);
        hotelContext.doAction();

        //预定状态
        BookedState bookedState = new BookedState();
        hotelContext.setHotelState(bookedState);
        hotelContext.doAction();

        //入住状态
        CheckinState checkinState = new CheckinState();
        hotelContext.setHotelState(checkinState);
        hotelContext.doAction();
    }
}